import java.util.Arrays;

/**
 * @author wangj881
 * @date 2024-11-25 17:38
 */
public class L344_2 {

    public static void main(String[] args) {
        char[] s = {'h', 'e', 'l', 'l', 'o'};
        new Solution().reverseString(s);
    }

    static class Solution {
        public void reverseString(char[] s) {
            int left = 0;
            int right = s.length - 1;
            while (left < right) {
                char tmp = s[left];
                s[left] = s[right];
                s[right] = tmp;
                left++;
                right--;
            }
            System.out.println(Arrays.toString(s));

        }
    }
}
